package org.smr.ministore.micro.client;

import java.util.List;

import org.blade.utils.Pager;
import org.smr.ministore.entities.Goods;
import org.smr.ministore.entities.GoodsOrgan;
import org.smr.ministore.entities.vo.Assign2OrganVO;
import org.smr.ministore.entities.vo.Assign2OrgansVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("goods.service")
public interface FeignGoodsMicroServiceClient {

    @RequestMapping(method = RequestMethod.PUT, value = "/Goods/batchSave")
    int batchSave(@RequestBody List<Goods> entities);

    @RequestMapping(method = RequestMethod.POST, value = "/Goods/batchModify")
    int batchModify(@RequestBody List<Goods> entities);

    @RequestMapping(method = RequestMethod.PUT, value = "/Goods/save")
    public int save(@RequestBody Goods entity);

    @RequestMapping(method = RequestMethod.PATCH, value = "/Goods/updateById")
    public int updateById(@RequestBody Goods id);

    @RequestMapping(method = RequestMethod.GET, value = "/Goods/queryById/{id}")
    public Goods queryById(@PathVariable("id") Long id);

    @RequestMapping(method = RequestMethod.DELETE, value = "/Goods/deleteById/{id}")
    public int deleteById(@PathVariable("id") Long id);

    @RequestMapping(method = RequestMethod.POST, value = "/Goods/paginate")
    public Pager<Goods> paginate(@RequestBody Goods entity, Long pageSize, Long pageNum);

    @ResponseBody
    @RequestMapping(method = RequestMethod.POST, value = "/Goods/selectByPrimaryKey")
    public Goods selectByPrimaryKey(@RequestBody Goods entity);

    @ResponseBody
    @RequestMapping(method = RequestMethod.DELETE, value = "/Goods/deleteByIdLogical/{id}")
    public int deleteByIdLogical(@PathVariable("id") Long id);

    @ResponseBody
    @RequestMapping(method = RequestMethod.POST, value = "/Goods/assign2Organs")
    public int assign(@RequestBody Assign2OrgansVO assignee);

    @ResponseBody
    @RequestMapping(method = RequestMethod.POST, value = "/Goods/assign2Organ")
    public int assign(@RequestBody Assign2OrganVO goodsAssign2Organ);

    @ResponseBody
    @RequestMapping(method = RequestMethod.POST, value = "/Goods/queryGoodsAssignee")
    public List<GoodsOrgan> queryGoodsAssignee(@RequestBody Assign2OrgansVO assignee);

}
